import request from '@/utils/request'

export function getPermissions(data) {
  return request({
    url: '/backup/web/permission/get_permissions',
    method: 'post',
    data
  })
}
export function addPermission(data) {
  return request({
    url: '/backup/web/permission/add_permission',
    method: 'post',
    data
  })
}
export function updatePermission(data) {
  return request({
    url: '/backup/web/permission/update_permission',
    method: 'post',
    data
  })
}
export function deletePermission(data) {
  return request({
    url: '/backup/web/permission/delete_permission',
    method: 'post',
    data
  })
}
/**  根据用户id获取角色信息*/
export function getRolebyUser(params) {
  return request({
    url: '/backup/web/role/get_role_by_user',
    method: 'get',
    params
  })
}

export function getRoles(data) {
  return request({
    url: '/backup/web/role/get_roles',
    method: 'post',
    data
  })
}
/**   根据角色id获取权限信息*/
export function getPermissionbyRolecondition(data) {
  return request({
    url: '/backup/web/permission/get_permission_by_role_condition',
    method: 'post',
    data
  })
}
/**   绑定或修改角色与权限关系数据*/
export function addUpdatePermissons(data) {
  return request({
    url: '/backup/web/role/add_update_permissons',
    method: 'post',
    data
  })
}

